package com.reader.cms.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class UploadConfig implements InitializingBean {

    @Value("${aliyun.oss.endpoint}")
    private String aliyunEndpoint;

    @Value("${aliyun.oss.accessKeyId}")
    private String aliyunAccessKeyId;

    @Value("${aliyun.oss.accessKeySecret}")
    private String aliyunAccessKeySecret;

    @Value("${aliyun.oss.bucketName}")
    private String aliyunBucketName;

    @Value("${aliyun.oss.fileHost}")
    private String aliyunFileHost;

    @Value("${upload.picture.maxsize}")
    private Double uploadPictureMaxsize;


    public static String aliyun_endpoint;
    public static String aliyun_accessKeyId;
    public static String aliyun_accessKeySecret;
    public static String aliyun_bucketName;
    public static String aliyun_fileHost;
    public static Double upload_pictureMaxsize;

    @Override
    public void afterPropertiesSet() throws Exception {
        aliyun_endpoint        =aliyunEndpoint;
        aliyun_accessKeyId     =aliyunAccessKeyId;
        aliyun_accessKeySecret =aliyunAccessKeySecret;
        aliyun_bucketName      =aliyunBucketName;
        aliyun_fileHost        =aliyunFileHost;
        upload_pictureMaxsize  =uploadPictureMaxsize;

    }

}
